//
//  LGHotCell.m
//  ifaxian
//
//  Created by ming on 16/12/7.
//  Copyright © 2016年 ming. All rights reserved.
//

#import "LGHotCell.h"

@interface LGHotCell()
@property (weak, nonatomic) IBOutlet UIImageView *featuresImageView;
@property (weak, nonatomic) IBOutlet UILabel *titleLable;

@property (weak, nonatomic) IBOutlet NSLayoutConstraint *imageViewHeight;


@end


@implementation LGHotCell

- (void)awakeFromNib {
    // Initialization code
}


- (void)setModel:(LGHotModel *)model{
    
    _model = model;
    
    self.titleLable.text = model.title;
    
    [self.featuresImageView lg_setImageWithurl:model.imageUrl placeholderImage:nil];
    
    if (model.imageSize.height) {
        
        self.imageViewHeight.constant = model.imageSize.height;
    }
    
}

- (void)setFrame:(CGRect)frame{
    
    CGRect cellFrame = frame;
    cellFrame.size.height -= LGCommonMargin;
    cellFrame.origin.y += LGCommonMargin;
    
    [super setFrame:cellFrame];
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
